package com.wiseman.writing.utility;

import android.util.Log;

public class TimeUtil {
	 static long t0;
	 static long t1;
	 static long t2;
	 
	 static public void reset()
	 {
		 t0 = 0;
		 t1 = 0;
		 t2 = 0;		 
	 }
	 
	 static  public void start()
	 {
		 t0 = System.currentTimeMillis();		 	
		 t1 = t2 = t0;
	 }
	 
	 static  public void check()
	{
		t1 = t2;
					
		t2 =System.currentTimeMillis();		
	}
	 	 
	static  public void check(String msg)
	{
		t1 = t2;
				
		t2 =System.currentTimeMillis();
		
		Log.i("TimeUtil", msg + ": "+
				"t2-t1=" + (t2-t1) + "ms " + 
				"t2-t0=" + (t2-t0) + "ms" );
	}
	
	static public long getDeltaTime()
	{
		return t2 - t1;
	}
	
}
